1. Field of the Invention
This invention relates to a micro controller, and particularly relates to a micro controller that processes compressed codes stored in a memory.
2. Prior Art
A micro controller is a device that is incorporated in a household electrical product, AV equipment, portable telephone, automobile, or other equipment and controls the equipment by performing processes in accordance with program codes stored in a memory.
Due to the property of being incorporated and used in equipments, the micro controller is required to exhibit the performance required to perform control of the equipment and be inexpensive at the same time.
However, in recent years, processes performed by micro controllers are becoming more complex and the programs necessary for processing are increasing in volume. The proportion that a program memory occupies within a micro controller is thus increasing and it is considered that this trend will continue into the future. Generally, as the capacity of a program memory increases, its cost increases accordingly, and how the program memory capacity can be kept low is thus an important problem in providing an inexpensive micro controller.
With general-purpose type information processing devices, such as personal digital assistants, etc., technologies for compressing program codes have been proposed for keeping the program memory capacity low, and actual applications of such technologies are also progressing.
For example, with a code compression technology called CodePack, proposed by IBM Corp., original codes are compressed and then stored in a program memory, etc. Here, in order to make the data compression ratio high, a compressed code is made a variable length bit pattern in accordance with the frequency of appearance, etc. In reading from the program memory, compressed codes are decompressed in predetermined block units and the decompressed original codes are stored in block units in a cache memory.
Since a compressed code has a variable length, the memory address of each code after compression will be irregular. A compressed code is thus made to contain information concerning its own code length, and in the reading process, the memory address of each compressed code is specified based on this information so that decompression will be carried out in order, starting from the compressed code at the head of a block.
Since compressed codes are decompressed in block units and stored in a cache memory, this code compression technology is considered especially effective for a general-purpose information processing device with which the hit rate of a cache memory is high and it is important to make the average program execution performance high.
However, though the formerly proposed code compression technology is suited, as mentioned above, for a general-purpose information processing device with which a high cache memory hit rate can be anticipated and it is important to make the average program execution performance high, it is not considered optimal necessarily for a micro controller or other embedded system.
This is due to the following reason. That is, with a micro controller or other embedded system, the loop processes in a program are few and the cache memory hit rate will not be as high as in a general-purpose information processing device. The rewriting of the cache memory thus occurs frequently. Since the rewriting of the cache memory is performed in block units, the decompression of a block containing a targeted code is performed each time rewriting is performed. Since in the case of a micro controller or other embedded system, codes besides the targeted code may not necessarily be used immediately subsequently, the decompression process can become excessive for simply acquiring the targeted code and the overhead for code decompression can become large. Also with an embedded system, a cache memory may not be equipped to start with since a high hit rate cannot be anticipated. Furthermore, with a micro controller or other embedded system, the real-time performance of enabling predetermined processes to be executed without fail within a control period is deemed more important than the average program execution performance.
Thus in comparison with a general-purpose type information processing device, that the address of a required compressed code can be specified at high speed is important with a micro controller or other embedded system.
An object of this invention is to provide a code compression technology that is favorable for a micro controller or other embedded system.